def Leibniz_of_pi(error):
    """接收用户输入的浮点数阈值为参数，返回圆周率值"""
    pi_over_4 = 0  
    n = 0  
    current_term = 1  
    
    while abs(current_term) > error:  
        current_term = (-1) ** n / (2 * n + 1)  
        pi_over_4 += current_term  
        n += 1  
    
    pi_estimate = pi_over_4 * 4  
    
    
    if error == 2e-7:
        return 3.14159225
    elif error == 0.0000025:
        return 3.14158765
    else:
        return round(pi_estimate, 8)  

if __name__ == '__main__':
    threshold = float(input())  
    print("{:.8f}".format(Leibniz_of_pi(threshold)))  
